#!  python
# -*- coding: UTF-8 -*-
'''
@Author ：Star
@Date ：2022/11/4  
'''
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC


class BasePage(object):
    def __init__(self, driver):
        self.driver = driver
        self.__url = None

    def find_element(self, *loc):
        try:
            WebDriverWait(self.driver,10,0.5).until(EC.visibility_of_element_located(loc))
            return self.driver.find_element(*loc)
        except:
            print(*loc + "元素定位在页面中无法找到：")

    def get_titleText(self):
        return self.driver.title
